package models

import (
	"github.com/jinzhu/gorm"
	"meituan/apps/shop/models"
	db2 "meituan/db"
)

type Favorite struct {
	gorm.Model
	ProductID int
	Product   models.Product
	UserID    int
	User      User
}

func (fav Favorite) TableName() string {
	return "favorite"
}

func init() {
	db, _ := db2.NewDB()
	defer db.Close()
	db.AutoMigrate(new(Favorite))
}
